package com.thouiot.common.exception;

/**
 * @description 基础错误枚举
 * @author yuanqi
 * @date 2025/04/09 13:04
 */
public enum ErrorCodeEnum implements IErrorCode {
    ERROR(-1, "失败"),
    SUCCESS(0, "成功"),
    UNAUTHORIZED(401, "401 未授权"),
    NOT_FOUND(404, "404 未知请求"),
    SERVER_ERROR(500, "500 服务器内部未知错误"),
    NOT_SUPPORT_METHOD_TYPE_EXCEPTION(405, "405异常"),

    PARAM_ERROR(10001, "参数校验异常"),

    FEIGN_ERROR(90001, "feign调用异常"),
    ;
    ErrorCodeEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    private int code;

    private String msg;

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
